import 'dart:ui' as ui;

/// 绘制相关的画笔样式
class PenStyle {
  final int lineColor;
  final int strokeLineColor;
  final int shadowColor; // 线的颜色，描边颜色，阴影半径，阴影颜色
  final double shadowRadius;

  final double lineWidth;
  final double imageWidth;
  final double strokeLineWidth;

  final ui.Image tapeImage;
  final List<ui.Image> scrawlImages;

  final double spacing;
  final double dashSpacing;
  final double dashWidth;
  final bool isVector; // 是否向量绘制

  PenStyle(
      {this.lineColor = 0,
      this.lineWidth = 0,
      this.dashWidth = 0,
      this.dashSpacing = 0,
      this.strokeLineColor = 0,
      this.strokeLineWidth = 0,
      this.shadowColor = 0,
      this.shadowRadius = 0,
      this.tapeImage,
      this.scrawlImages,
      this.imageWidth = 0,
      this.spacing = 0,
      this.isVector = false});

//    debugPrint('brushId : $brushId \n'
//        'lineColor : $lineColor \n'
//        'lineWidth : $lineWidth \n'
//        'dashWidth : $dashWidth \n'
//        'dashSpacing : $dashSpacing \n'
//        'strokeLineColor : $strokeLineColor \n'
//        'strokeLineWidth : $strokeLineWidth \n'
//        'shadowColor : $shadowColor \n'
//        'shadowRadius : $shadowRadius \n'
//        'tapeImage : $tapeImage \n'
//        'images : ${images.toString()} \n'
//        'imageWidth : $imageWidth \n'
//        'spacing : $spacing \n'
//        'isVector : $isVector \n');

  PenStyle copyWith({
    int lineColor,
    int strokeLineColor,
    int shadowColor,
    double shadowRadius,
    double lineWidth,
    double imageWidth,
    double strokeLineWidth,
    ui.Image tapeImage,
    List<ui.Image> scrawlImages,
    double spacing,
    double dashSpacing,
    double dashWidth,
    bool isVector,
  }) {
    return PenStyle(
      lineColor: lineColor ?? this.lineColor,
      strokeLineColor: strokeLineColor ?? this.strokeLineColor,
      shadowColor: shadowColor ?? this.shadowColor,
      shadowRadius: shadowRadius ?? this.shadowRadius,
      lineWidth: lineWidth ?? this.lineWidth,
      imageWidth: imageWidth ?? this.imageWidth,
      strokeLineWidth: strokeLineWidth ?? this.strokeLineWidth,
      tapeImage: tapeImage ?? this.tapeImage,
      scrawlImages: scrawlImages ?? this.scrawlImages,
      spacing: spacing ?? this.spacing,
      dashSpacing: dashSpacing ?? this.dashSpacing,
      dashWidth: dashWidth ?? this.dashWidth,
      isVector: isVector ?? this.isVector,
    );
  }
}
